<?php


namespace core\utils;


class ArrayUtil
{
    static function group($items, $key)
    {
        $newArr = array();
        foreach ($items as $item) {
            if (!isset($newArr[$item[$key]])) {
                $newArr[$item[$key]] = array();
            }
            $newArr[$item[$key]][] = $item;
        }
        return $newArr;
    }

}